<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
 <input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<div class="t_bar"><span class="color_red">*</span>实验动物饲料来源和质量保障</div>





<table  id="check1" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
<tr>
<td style="width:15%">实验动物饲料来源：</td>
<td style="width:85%">
  <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="do " id="feed_resource_01" style="vertical-align: middle;" name="feed_resource" label="购买" value="01" onchange="isShow6()"/><span style="vertical-align: middle;">购买</span></label> 
	<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="do " id="feed_resource_02" style="vertical-align: middle;" name="feed_resource" label="自产" value="02" onchange="isShow6()"/><span style="vertical-align: middle;">自产</span></label>
	<input type="hidden" name="proposal/feed_resource_value" id="feed_resource_value" class="required" value="<x:out select="$xmlData/data/proposal/feed_resource_value" />" label="实验动物饲料来源 " /> 
	<input type="hidden" name="proposal/feed_resource_name" id="feed_resource_name" value="<x:out select="$xmlData/data/proposal/feed_resource_name" />" label="实验动物饲料来源 " /></td>
</td>
</tr>
</table>
<script type="text/javascript">
function isShow6(){
	var text1= $("#feed_resource_value").val();
	if (text1 == '01'){
		$("#div5").css("display","");
		$("#div6").css("display","none");
		
		//alert($("#div5").find("tr:visible").not(":eq(0)").html());
		//alert($("#div6").find("tr:visible").not(":eq(0)").html());
		$("#div5").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
				$(this).addClass("required");
			}
		});
		
		$("#div6").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
			$(this).removeClass("required");
			}
		});
		
	}
	else{
		$("#div6").css("display","");
		$("#div5").css("display","none");
		
		$("#div5").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
			$(this).removeClass("required");
			}
		});
		
		$("#div6").find("tr:gt(1)").find("td:gt(1)").find("input").each(function(){
			if($(this).attr("name").indexOf("name")==-1){
			$(this).addClass("required");
			}
		});
		
		$("#tblMileStones7").find("input[name$='/content2']").removeClass("required");
		$("#tblMileStones7").find("input[name$='/content3']").removeClass("required");
		
	}	
}



$(document).ready(function(){
	isShow6();
});

</script>



<!-- 如果购买填写下表 -->
<div id = "div5" style="display:none">
<table  id="tblMileStones6" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
   <thead >
					<tr style="border:1px solid #B7D1E6">
					  <th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="15%">动物种类</th>
						<th class="TblHead" align="center"  width="15%">饲料种类</th>
						<th class="TblHead" align="center"  width="60%">购买单位（可以多填，用分号隔开）</th> 
					</tr>
		</thead>
		
		
		
    <tbody id="tab">
		      <tr style="display:none">

            <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones6" >
						</td>

						<td align="center">
							<span name="milestones6|milestone[0]@seq_no" >[index]</span> 
						</td>
						
						<td align="center">
						  <input type="text"  id="content1[0]" name="milestones6|milestone[0]|content1" label="动物种类"  maxlength="10"
						         class="required input_text"  value=""  style="width:80%"/>
						</td>
						
						<td align="center">
						       <cpt:select id="feed_type[index]" name="feed_type"  key="feed_type" onChange="initControlValue(this.id)"  style="width:80%" ></cpt:select>
				           <input type="hidden" name="milestones6|milestone[0]|feed_type_value" value="" class="required"  label="饲料种类"/>
				           <input type="hidden" name="milestones6|milestone[0]|feed_type_name" value="" />
			      </td>
		
		        <td align="center">
						  <input type="text"  id="content3[0]" name="milestones6|milestone[0]|content3" label="购买单位"  maxlength="20"
						         class="required input_text"  value=""  style="width:80%"/>
						</td>
		</tr>
		

	   	    <c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/milestones6/milestone" var="milestone">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr>
					
					  <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones6" >
						</td>
					
					
						<td align="center">
							<span   name="milestones6/milestone[${flag}${index}]@seq_no"><x:out select="$milestone/@seq_no"/></span> 
						</td>
						
						<td align="center">
						    <input type="text"  id="content1[${flag}${index}]" label="动物种类"  maxlength="10"  name="milestones6/milestone[${flag}${index}]/content1"
						           value="<x:out select="$milestone/content1"/>"   style="width:80%"   class="required input_text"/>
						</td>
						   
						   
						<td align="center">
			        <c:set var="feed_type"><x:out select="$milestone/feed_type_value" /></c:set>
			        <cpt:select id="feed_type${index}"   name="feed_type"   key="feed_type" style="width: 80%;" value="${feed_type}" onChange="initControlValue(this.id)"></cpt:select>
		        	<input type="hidden" name="milestones6/milestone[${flag}${index}]/feed_type_value"  class="required" value="<x:out select="$milestone/feed_type_value" />" label="饲料种类"/>
			        <input type="hidden" name="milestones6/milestone[${flag}${index}]/feed_type_name" value="<x:out select="$milestone/feed_type_name" />"  label="饲料种类"/>
		        </td>
						   
						
	          <td align="center">
						    <input type="text"  id="content3[${flag}${index}]"  maxlength="20"  name="milestones6/milestone[${flag}${index}]/content3"  label='购买单位'
						           value="<x:out select="$milestone/content3"/>"   style="width:80%"   class="required input_text"/> 
						</td>
						   
		        
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblMileStones6");
					</script>
				</tbody>
</table>
<br/>

<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones6',20,'实验动物饲料来源和质量保障最多只能填写20条')){addNewRow('tblMileStones6');showDateTag('tblMileStones6');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones6','selMileStones6')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones6','selMileStones6')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones6','实验动物饲料来源和质量保障')">
					</td></tr>
	</table>
<p>注：1、根据国家标准GB14924.1-3要求，检测项目至少包括感官指标，常规营养指标，氨基酸指标，卫生指标，每年至少检测一次。申请新产品增加维生素指标、矿物质指标和微量元素指标。各单位可根据自己的情况增加实验动物饲料质量控制要求。<br/>
<span style="visibility: hidden">注：</span>2、检测方式为自检或委托检测，委托检测需填写委托检测单位。</p>
</div>



<!-- 如果自产填写下表 -->
<div id = "div6" style="display:none">
<table  id="tblMileStones7" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
   <thead >
					<tr style="border:1px solid #B7D1E6">
					  <th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="15%">动物种类</th>
						<th class="TblHead" align="center"  width="15%">饲料种类</th>
						<th class="TblHead" align="center"  width="20%">检测项目</th> 
						<th class="TblHead" align="center"  width="15%">检测时间</th> 
						<th class="TblHead" align="center"  width="35%">检测方式</th> 
					</tr>
		</thead>
		
		
		
    <tbody id="tab">
		      <tr style="display:none">

            <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones7" >
						</td>

						<td align="center">
							<span name="milestones7|milestone[0]@seq_no" >[index]</span> 
						</td>
						
						<td align="center">
						  <input type="text"  id="content1[0]" name="milestones7|milestone[0]|content1" label="动物种类"  maxlength="10"
						         class="required input_text"  value=""  style="width:80%"/>
						</td>
						
						<td align="center">
						       <cpt:select id="feed_type_1[index]" name="feed_type"  key="feed_type" onChange="initControlValue(this.id)"  style="width:80%" ></cpt:select>
				           <input type="hidden" name="milestones7|milestone[0]|feed_type_value" value="" class="required"  label="饲料种类"/>
				           <input type="hidden" name="milestones7|milestone[0]|feed_type_name" value="" />
			      </td>
			      
		
		        <td align="center">
		                              常规营养指标,氨基酸指标,<br/>卫生指标<br/>
						       <cpt:select id="test_item2[index]" name="test_item2"  key="test_item2" onChange="initControlValue(this.id);isShow4(this)"  style="width:80%" ></cpt:select>
				           <input type="hidden" name="milestones7|milestone[0]|test_item2_value" value="" class="required"  label="检测项目"/>
				           <input type="hidden" name="milestones7|milestone[0]|test_item2_name" value="" />
				            
				            <br/>
				           <span style="display:none">其他检测项目:<input type="text"  id="content2[0]" name="milestones7|milestone[0]|content2" label="其他检测项目"  maxlength="5"
						                 class="input_text required"  value=""  style="width:50%"/>
						       </span>
			      </td>
		
		

		        <td align="center">
							<input  id="milestone_date_[0]" name="milestones7|milestone[0]|date" value="" class=" required input_text date" style="width:70px" label="检测时间" />
						</td>
		
		        <td align="center">
						       <cpt:select id="test_method_3_[index]" name="test_method"  key="test_method" onChange="initControlValue(this.id);isShow5(this)"  style="width:80%" ></cpt:select>
				           <input type="hidden" name="milestones7|milestone[0]|test_method_value" value="" class="required"  label="检测方式"/>
				           <input type="hidden" name="milestones7|milestone[0]|test_method_name" value="" />
			      
			      <br/>
			          <span style="display:none">委托检测单位:<input type="text"  id="content3[0]" name="milestones7|milestone[0]|content3" label="委托检测单位"  maxlength="20"
						                 class="input_text required"  value=""  style="width:50%"/>
						    </span>
			      
			      
			      </td>
		</tr>
		

	   	    <c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/milestones7/milestone" var="milestone">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr>
					
					  <td align="center">
							<input type="radio" class="radiobutton" name="selMileStones7" >
						</td>
					
					
						<td align="center">
							<span   name="milestones7/milestone[${flag}${index}]@seq_no"><x:out select="$milestone/@seq_no"/></span> 
						</td>
						
						<td align="center">
						    <input type="text"  id="content1[${flag}${index}]" label="动物种类"  maxlength="10"  name="milestones7/milestone[${flag}${index}]/content1"
						           value="<x:out select="$milestone/content1"/>"   style="width:80%"   class="required input_text"/>
						</td>
						   
						   
					<td align="center">
			        <c:set var="feed_type"><x:out select="$milestone/feed_type_value" /></c:set>
			        <cpt:select id="feed_type_1${index}"   name="feed_type"   key="feed_type" style="width: 80%;" value="${feed_type}" onChange="initControlValue(this.id)"></cpt:select>
		        	<input type="hidden" name="milestones7/milestone[${flag}${index}]/feed_type_value"  class="required" value="<x:out select="$milestone/feed_type_value" />" label="饲料种类"/>
			        <input type="hidden" name="milestones7/milestone[${flag}${index}]/feed_type_name" value="<x:out select="$milestone/feed_type_name" />"  label="饲料种类"/>
		        </td>
						   
						   
						   
						<td align="center">
						 常规营养指标,氨基酸指标,<br/>卫生指标<br/>
			        <c:set var="test_item2"><x:out select="$milestone/test_item2_value" /></c:set>
			        <cpt:select id="test_item2${index}"   name="test_item2"   key="test_item2" style="width: 80%;" value="${test_item2}" onChange="initControlValue(this.id);isShow4(this)"></cpt:select>
		        	<input type="hidden" name="milestones7/milestone[${flag}${index}]/test_item2_value"  class="required" value="<x:out select="$milestone/test_item2_value" />" label="检测项目"/>
			        <input type="hidden" name="milestones7/milestone[${flag}${index}]/test_item2_name" value="<x:out select="$milestone/test_item2_name" />"  label="检测项目"/>
		        
						  <br/>
						    <span style="display:none">其他检测项目:<input type="text"  id="content2[${flag}${index}]" label="其他检测项目"  maxlength="5"  name="milestones7/milestone[${flag}${index}]/content2"
						           value="<x:out select="$milestone/content2"/>"   style="width:30%"   class="required input_text"/>
						    </span>
						</td>
						
						
						
						<td align="center">
							<c:set var="date" scope="page"><x:out select="$milestone/date"/></c:set>
							<input  id="milestone_date_[${flag}${index}]" value="${date}" label="检测时间" name="milestones7/milestone[${flag}${index}]/date" class="required date input_text"  style="width:70px"/> 
						</td>
					
						<td align="center">
			        <c:set var="test_method"><x:out select="$milestone/test_method_value" /></c:set>
			        <cpt:select id="test_method_3_${index}"   name="test_method"   key="test_method" style="width: 80%;" value="${test_method}" onChange="initControlValue(this.id);isShow5(this)"></cpt:select>
		        	<input type="hidden" name="milestones7/milestone[${flag}${index}]/test_method_value"  class="required" value="<x:out select="$milestone/test_method_value" />" label="检测方式"/>
			        <input type="hidden" name="milestones7/milestone[${flag}${index}]/test_method_name" value="<x:out select="$milestone/test_method_name" />"  label="检测方式"/>
		        
		        <br/>
						    <span style="display:none">委托检测单位:<input type="text"  id="content3[${flag}${index}]" label="委托检测单位"  maxlength="20"  name="milestones7/milestone[${flag}${index}]/content3"
						           value="<x:out select="$milestone/content3"/>"   style="width:30%"   class="required input_text"/>
						    </span>

		        </td>
		        
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblMileStones7");
					</script>
				</tbody>
</table>

<br/>

<table width="98%" align="center">
					<tr ><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblMileStones7',20,'实验动物饲料来源和质量保障最多只能填写20条')){addNewRow('tblMileStones7');showDateTag('tblMileStones7');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblMileStones7','selMileStones7')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblMileStones7','selMileStones7')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblMileStones7','实验动物饲料来源和质量保障')">	
					</td></tr>
	</table>
<p>注：1、根据国家标准GB14924.1-3要求，检测项目至少包括感官指标，常规营养指标，氨基酸指标，卫生指标，每年至少检测一次。申请新产品增加维生素指标、矿物质指标和微量元素指标。各单位可根据自己的情况增加实验动物饲料质量控制要求。<br/>
<span style="visibility: hidden">注：</span>2、检测方式为自检或委托检测，委托检测需填写委托检测单位。</p>
	</div>
<br/>



<script type="text/javascript">
    function isShow4(obj){
    var text1 = $(obj).parents().find("td:eq(4)").find("[name$='_value']").val();
    //alert($(obj).parents().find("td:eq(5)").html());
    if (text1 == '04'){
    	$(obj).parents().find("td:eq(4)").find("span").css("display","");
    	$(obj).parents().find("td:eq(4)").find("span").find("[id^='content']").addClass("required");
          }	
    else{
    	$(obj).parents().find("td:eq(4)").find("span").hide();
    	$(obj).parents().find("td:eq(4)").find("span").find("[id^='content']").val("");
    	$(obj).parents().find("td:eq(4)").find("span").find("[id^='content']").removeClass("required");
          }	
    
    
    }
    
    function isShow5(obj){
        var text1 = $(obj).parents().find("td:eq(6)").find("[name$='_value']").val();
        //alert($(obj).parents().find("td").html());
        if (text1 == '02'){
        	$(obj).parents().find("td:eq(6)").find("span").css("display","");
        	$(obj).parents().find("td:eq(6)").find("span").find("[id^='content']").addClass("required");
              }	
        else{
        	$(obj).parents().find("td:eq(6)").find("span").hide();
        	$(obj).parents().find("td:eq(6)").find("span").find("[id^='content']").val("");
        	$(obj).parents().find("td:eq(6)").find("span").find("[id^='content']").removeClass("required");
              }	
        
        
        }
    
    
    
/*   $(document).ready(function(){
    	$("input[name$='/content2']").each(function(){
    		isShow(this);
    	)};
    });  */
    
  
  $(document).ready(function(){
	  $("#tblMileStones7").find("input[name$='/content2']").each(function(){
		  isShow4(this);
	  });
	  $("#tblMileStones7").find("input[name$='/content3']").each(function(){
		  isShow5(this);
	  });
  });
  
  
  
  
  
  
  
</script>